﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace TV4Home.MvcWebInterface.UI.Controllers
{
    public class TvSeriesLibraryController : Controller
    {
        public ActionResult Index()
        {
            var series = WebService.GmaWebService.ServiceInstance.MP_GetAllSeries();
            return View(series);
        }
        public ActionResult Seasons(int serie)
        {
            var seasons = WebService.GmaWebService.ServiceInstance.MP_GetAllSeasons(serie);
            return View(seasons);
        }
        public ActionResult Episodes(int serie, int season)
        {
            var episodes = WebService.GmaWebService.ServiceInstance.MP_GetAllEpisodesForSeason(serie, season);
            return View(episodes);

        }
        public ActionResult Image(int serie, int season)
        {

            byte[] image = System.IO.File.ReadAllBytes(WebService.GmaWebService.ServiceInstance.MP_GetSeason(serie, season).SeasonBanner);
            return File(image, "image/jpg");
        }
        public ActionResult SeriesFanart(int serie)
        {

            byte[] image = System.IO.File.ReadAllBytes(WebService.GmaWebService.ServiceInstance.MP_GetFullSeries(serie).CurrentFanartUrl);
            return File(image, "image/jpg");
        }

    }
}
